package com.lansea.wms.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.lansea.wms.entity.ValidClass;
import com.lansea.wms.model.base.BaseUser;
import com.lansea.wms.util.DateUtil;
import com.lansea.wms.validate.CodeValidate;
import com.lansea.wms.validate.RemarkValidate;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Repository;

import javax.validation.constraints.Min;
import java.util.Date;
@Data
@Repository
@ApiModel(value = "Delivery", description = "发货物流")
public class Delivery extends BaseUser {

    @Min(value = 1, message = "id 非法", groups = {ValidClass.EditForm.class})
    private Integer id;

    @Min(value = 1, message = "请选择出库单")
    private Integer stockEntryId;

    @Min(value = 1, message = "请选择承运商")
    private Integer companyId;

    @CodeValidate(message = "快递单号长度为 2-40")
    private String number;

    @DateTimeFormat(pattern = DateUtil.DATE_FORMAT)
    @JsonFormat(pattern = DateUtil.DATE_FORMAT)
    private Date happenTime;

    @RemarkValidate
    private String remark;

    private String stockEntryNumber;
    private String companyCode;
    private String companyName;
    private String companyAddress;
    private String companyUserName;
    private String companyPhone;
    private String companyMobile;
    private String companyEmail;



}
